<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Scan for 0</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.gmp-rootrem.html">« gmp_rootrem</a></li>
      <li style="float: right;"><a href="function.gmp-scan1.html">gmp_scan1 »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.gmp.html">GMP 函数</a></li>
    <li>Scan for 0</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.gmp-scan0" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmp_scan0</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gmp_scan0</span> &mdash; <span class="dc-title">Scan for 0</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.gmp-scan0-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmp_scan0</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.gmp.html" class="type GMP">GMP</a></span>|<span class="type">int</span>|<span class="type">string</span></span> <code class="parameter">$num1</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$start</code></span>): <span class="type">int</span></div>

  <p class="para rdfs-comment">
   Scans <code class="parameter">num1</code>, starting with bit
   <code class="parameter">start</code>, towards more significant bits,
   until the first clear bit is found. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmp-scan0-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">num1</code></dt>

     <dd>

      <p class="para">
       The number to scan.
      </p>
      <p class="para"><span class="classname"><a href="class.gmp.html" class="classname">GMP</a></span> 对象或 <span class="type">int</span> ，或数字<span class="type">string</span>。</p> 
     </dd>

    
    
     <dt>
<code class="parameter">start</code></dt>

     <dd>

      <p class="para">
       The starting bit.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gmp-scan0-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the index of the found bit, as an <span class="type">int</span>. The
   index starts from 0.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmp-scan0-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3069">
    <p><strong>示例 #1 <span class="function"><strong>gmp_scan0()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;"0"&nbsp;bit&nbsp;is&nbsp;found&nbsp;at&nbsp;position&nbsp;3.&nbsp;index&nbsp;starts&nbsp;at&nbsp;0<br /></span><span style="color: #0000BB">$s1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"10111"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">gmp_scan0</span><span style="color: #007700">(</span><span style="color: #0000BB">$s1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;"0"&nbsp;bit&nbsp;is&nbsp;found&nbsp;at&nbsp;position&nbsp;7.&nbsp;index&nbsp;starts&nbsp;at&nbsp;5<br /></span><span style="color: #0000BB">$s2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">gmp_init</span><span style="color: #007700">(</span><span style="color: #DD0000">"101110000"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #0000BB">gmp_scan0</span><span style="color: #007700">(</span><span style="color: #0000BB">$s2</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">5</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
3
7
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div></div></div></body></html>